﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using Conqueror.WP.ViewModel.Games;
using Microsoft.Phone.Tasks;

namespace Conqueror.WP.View
{
    public partial class SelectedGameCard : SelectedCardBase
    {
        public SelectedGameCard()
            : base()
        {
            InitializeComponent();
        }

        private void OpenGameAction(object sender, System.Windows.Input.GestureEventArgs e)
        {
            GameViewModel gvm = (sender as FrameworkElement).DataContext as GameViewModel;
            string link = string.Format("http://www.conquerclub.com/game.php?game={0}", gvm.GameNumber);
            WebBrowserTask task = new WebBrowserTask();
            task.Uri = new Uri(link, UriKind.Absolute);
            task.Show();
        }
    }
}
